﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LloydGame
{
    public class Singleton<T> where T : class, new()
    {
        private static readonly T m_instance = new T();

        protected Singleton()
        {
        }

        public static T instance
        {
            get
            {
                return m_instance;
            }
        }
    }

    public class WrappingSingleton<T, S> : Singleton<T> where T : class, new()
    {
        private static S m_wrappedObj;

        protected WrappingSingleton()
        {
        }

        public static new S instance
        {
            get
            {
                return m_wrappedObj;
            }
            set
            {
                m_wrappedObj = value;
            }
        }
    }
}
